
//发送异步请求，与服务器进行交换
import request from "../untils/request";

//查询所有的部门信息
/* const queryAllApi = ()=>{
    return request.get('/depts')
} */


export const queryAllApi = () => request.get('/depts');

//新增部门
export const addApi = (dept) => request.post('/depts', dept);

//查询回显，根据Id先查询
export const queryByIdApi = (id) => request.get(`/depts/${id}`);

//保存修改
export const updateApi = (dept) => request.put(`/depts`, dept);

//删除部门
export const deleteApi = (id) => request.delete(`/depts?id=${id}`);
